"""rules_julia"""

module(
    name = "rules_julia",
    version = "0.2.0",
)

bazel_dep(name = "bazel_skylib", version = "1.8.2")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "rules_cc", version = "0.2.4")

# Register Julia toolchains for development
julia = use_extension("//julia:extensions.bzl", "julia", dev_dependency = True)
julia.toolchain(
    name = "julia_toolchains",
)
use_repo(julia, "julia_toolchains")

register_toolchains(
    "@julia_toolchains//:all",
    dev_dependency = True,
)

# Julia package dependencies for standalone compiler
sac_deps = use_extension("//julia/pkg:extensions.bzl", "pkg")
sac_deps.install(
    name = "rules_julia_sac",
    lockfile = "//julia/private/standalone_compiler:Manifest.bazel.json",
)
sac_deps.pkg_annotation(
    dep = "PackageCompiler",
    patch_args = ["-p1"],
    patches = ["@//julia/private/standalone_compiler/3rdparty/patches:issue-1066.patch"],
)
use_repo(
    sac_deps,
    "rules_julia_sac",
)

# Julia package dependencies for formatting
fmt_deps = use_extension("//julia/pkg:extensions.bzl", "pkg")
fmt_deps.install(
    name = "rules_julia_fmt",
    lockfile = "//julia/private/format:Manifest.bazel.json",
)
fmt_deps.pkg_annotation(
    dep = "Preferences",
    patch_args = ["-p1"],
    patches = ["@//julia/private/format/3rdparty/patches:Preferences.patch"],
)
use_repo(
    fmt_deps,
    "rules_julia_fmt",
)

bazel_dep(name = "stardoc", version = "0.8.0", dev_dependency = True, repo_name = "io_bazel_stardoc")
bazel_dep(name = "rules_rust_mdbook", version = "0.64.0", dev_dependency = True)
bazel_dep(name = "rules_shell", version = "0.5.0", dev_dependency = True)
